from tkinter import*
def rad():
    m=float(u2.get())*1000
    h=float(u3.get())
    s=float(u4.get())*1000
    w=m*9.81*h
    t=round(w/s,2)
    rez1=Label(p,text='Izvršeni rad je '+str(w/1000)+' kJ',font=14)
    rez1.place(x=20,y=200)
    rez2=Label(p,text='Vrijeme podizanja je '+str(t)+' s',font=14)
    rez2.place(x=20,y=220)
    return
    
p=Tk()
p.config(width=320, height=280)

t1=Label(p,text='RAD-SNAGA-ENERGIJA',font=('Arial',12))
t1.place(x=70, y=20)

t2=Label(p, text='Unesi masu tijela (t):')
t2.place(x=50,y=60)
u2=Entry(p)
u2.place(x=170,y=60,width=80)

t3=Label(p, text='Unesi visinu dizanja (m):')
t3.place(x=28,y=90)
u3=Entry(p)
u3.place(x=170,y=90,width=80)

t4=Label(p, text='Unesi snagu dizalice (kW):')
t4.place(x=20,y=120)
u4=Entry(p)
u4.place(x=170,y=120,width=80)


g=Button(p,text='Izračunaj',command=rad)
g.place(x=160,y=160,width=70)



p.mainloop()
